import fetch from 'common/src/utils/fetch';

const pageUrl =
    '/api/electionservice/graduateExamMessage/listGraduateExamMessage';

/**
 *根据教室Id查询学生名单
 */
function getStuList(examRoomId, examInfoId) {
    return fetch({
        url:
            '/api/electionservice/graduateInfo/getExamStudentByRoomId?examRoomId=' +
            examRoomId + "&examInfoId=" + examInfoId,
        method: 'get'
    });
}
/**
 *根据排考Id查询学生名单
 */
function getNoExamTimeStuList(examInfoId) {
  return fetch({
    url:
      '/api/electionservice/graduateInfo/getNoExamTimeStuList?examInfoId=' +examInfoId,
    method: 'get'
  });
}
/**
 *地点时间学校通知   根据排考Id查询学生名单
 */
function getNewExamTimeStuList(calendarId,courseCode,campus){
    return fetch({
        url:
        '/api/electionservice/graduateInfo/listSpecialArrangementStudents?calendarId='+calendarId +'&courseCode='+ courseCode+'&campus='+campus,
      method: 'get'
    })
}
/**
 *导出
 */
function exportData(data) {
    return fetch({
        url: '/api/electionservice/graduateExamMessage/export',
        method: 'post',
        data: data,
        showMask: false
    });
}
/**
 *导出签到表
 */
function exportCheckTable(calendarId, examType, calendarName) {
    return fetch({
        url:
            '/api/electionservice/graduateExamMessage/exportCheckTable?calendarId=' +
            calendarId +
            '&examType=' +
            examType +
            '&calendarName=' +
            calendarName,
        method: 'get',
        showMask: false
    });
}

/**
 *导出签到表 (freemarker)
 */
function exportCheckTableFreemarker(calendarId, examType, calendarName) {
    return fetch({
        url:
            '/api/electionservice/graduateExamMessage/exportCheckTableFreemarker?calendarId=' +
            calendarId +
            '&examType=' +
            examType +
            '&calendarName=' +
            calendarName,
        method: 'get',
        showMask: false
    });
}

/**
 *导出学生名单
 */
function exportStuList(data) {
    return fetch({
        url: '/api/electionservice/graduateExamMessage/exportStuList',
        method: 'post',
        data: data,
        showMask: false
    });
}

/**
 *导出物业单
 */
function exportPropertySheet(data) {
    return fetch({
        url: '/api/electionservice/graduateExamMessage/exportPropertySheet',
        method: 'post',
        data: data,
        showMask: false
    });
}
/**
 *导出巡考单
 */
function exportInspectionSheet(data) {
    return fetch({
        url: '/api/electionservice/graduateExamMessage/exportInspectionSheet',
        method: 'post',
        data: data,
        showMask: false
    });
}

/**
 * 获取key
 */
function exportStatus(key) {
    return fetch({
        url: '/api/electionservice/reportManagement/result/' + key,
        method: 'get'
    });
}

/**
 * 获取key
 */
function getObsKey(obsKey) {
    return fetch({
        url: '/api/electionservice/graduateExamMessage/resultObs/' + obsKey,
        method: 'get'
    });
}

export default {
  pageUrl: pageUrl,
  getStuList: getStuList,
  getNoExamTimeStuList:getNoExamTimeStuList,
  exportData: exportData,
  exportStatus: exportStatus,
  exportStuList: exportStuList,
  exportCheckTable: exportCheckTable,
  exportPropertySheet: exportPropertySheet,
  exportInspectionSheet: exportInspectionSheet,
  getObsKey: getObsKey,
  exportCheckTableFreemarker: exportCheckTableFreemarker,
  getNewExamTimeStuList:getNewExamTimeStuList
};
